package com.wdl.modules.myhouse.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wdl.modules.myhouse.dao.UserDao;
import com.wdl.modules.myhouse.entity.UserEntity;
import com.wdl.modules.myhouse.security.entity.UserInfo;
import com.wdl.modules.myhouse.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 用户表
 *
 * @author lucain sunlightcs@gmail.com
 * @since 1.0.0 2022-08-13
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public UserEntity getUserByUserId(Integer userId) {
        return userDao.selectOne(new QueryWrapper<UserEntity>().lambda().eq(UserEntity::getUserId,userId));
    }

    @Override
    public UserInfo getUserInfoByMail(String mail) {

        return userDao.selectUserByMail(mail);

    }
}